Optimal. Leaf size=237 \[ \frac{\left (2 a^3 A-4 a^2 b B+3 a A b^2-b^3 B\right ) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}}-\frac{\left (11 a^2 A b-2 a^3 B-13 a b^2 B+4 A b^3\right ) \tan (c+d x)}{6 d \left (a^2-b^2\right )^3 (a+b \sec (c+d x))}-\frac{\left (-2 a^2 B+5 a A b-3 b^2 B\right ) \tan (c+d x)}{6 d \left (a^2-b^2\right )^2 (a+b \sec (c+d x))^2}-\frac{(A b-a B) \tan (c+d x)}{3 d \left (a^2-b^2\right ) (a+b \sec (c+d x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.509945, antiderivative size = 237, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {4003, 12, 3831, 2659, 208} \[ \frac{\left (2 a^3 A-4 a^2 b B+3 a A b^2-b^3 B\right ) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{d (a-b)^{7/2} (a+b)^{7/2}}-\frac{\left (11 a^2 A b-2 a^3 B-13 a b^2 B+4 A b^3\right ) \tan (c+d x)}{6 d \left (a^2-b^2\right )^3 (a+b \sec (c+d x))}-\frac{\left (-2 a^2 B+5 a A b-3 b^2 B\right ) \tan (c+d x)}{6 d \left (a^2-b^2\right )^2 (a+b \sec (c+d x))^2}-\frac{(A b-a B) \tan (c+d x)}{3 d \left (a^2-b^2\right ) (a+b \sec (c+d x))^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4003
Rule 12
Rule 3831
Rule 2659
Rule 208
Rubi steps
\begin{align*} \int \frac{\sec (c+d x) (A+B \sec (c+d x))}{(a+b \sec (c+d x))^4} \, dx &=-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\int \frac{\sec (c+d x) (-3 (a A-b B)+2 (A b-a B) \sec (c+d x))}{(a+b \sec (c+d x))^3} \, dx}{3 \left (a^2-b^2\right )}\\ &=-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\left (5 a A b-2 a^2 B-3 b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^2}+\frac{\int \frac{\sec (c+d x) \left (2 \left (3 a^2 A+2 A b^2-5 a b B\right )-\left (5 a A b-2 a^2 B-3 b^2 B\right ) \sec (c+d x)\right )}{(a+b \sec (c+d x))^2} \, dx}{6 \left (a^2-b^2\right )^2}\\ &=-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\left (5 a A b-2 a^2 B-3 b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^2}-\frac{\left (11 a^2 A b+4 A b^3-2 a^3 B-13 a b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \sec (c+d x))}-\frac{\int -\frac{3 \left (2 a^3 A+3 a A b^2-4 a^2 b B-b^3 B\right ) \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{6 \left (a^2-b^2\right )^3}\\ &=-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\left (5 a A b-2 a^2 B-3 b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^2}-\frac{\left (11 a^2 A b+4 A b^3-2 a^3 B-13 a b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \sec (c+d x))}+\frac{\left (2 a^3 A+3 a A b^2-4 a^2 b B-b^3 B\right ) \int \frac{\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{2 \left (a^2-b^2\right )^3}\\ &=-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\left (5 a A b-2 a^2 B-3 b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^2}-\frac{\left (11 a^2 A b+4 A b^3-2 a^3 B-13 a b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \sec (c+d x))}+\frac{\left (2 a^3 A+3 a A b^2-4 a^2 b B-b^3 B\right ) \int \frac{1}{1+\frac{a \cos (c+d x)}{b}} \, dx}{2 b \left (a^2-b^2\right )^3}\\ &=-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\left (5 a A b-2 a^2 B-3 b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^2}-\frac{\left (11 a^2 A b+4 A b^3-2 a^3 B-13 a b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \sec (c+d x))}+\frac{\left (2 a^3 A+3 a A b^2-4 a^2 b B-b^3 B\right ) \operatorname{Subst}\left (\int \frac{1}{1+\frac{a}{b}+\left (1-\frac{a}{b}\right ) x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{b \left (a^2-b^2\right )^3 d}\\ &=\frac{\left (2 a^3 A+3 a A b^2-4 a^2 b B-b^3 B\right ) \tanh ^{-1}\left (\frac{\sqrt{a-b} \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a+b}}\right )}{(a-b)^{7/2} (a+b)^{7/2} d}-\frac{(A b-a B) \tan (c+d x)}{3 \left (a^2-b^2\right ) d (a+b \sec (c+d x))^3}-\frac{\left (5 a A b-2 a^2 B-3 b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^2 d (a+b \sec (c+d x))^2}-\frac{\left (11 a^2 A b+4 A b^3-2 a^3 B-13 a b^2 B\right ) \tan (c+d x)}{6 \left (a^2-b^2\right )^3 d (a+b \sec (c+d x))}\\ \end{align*}
Mathematica [A] time = 1.05016, size = 404, normalized size = 1.7 \[ \frac{\sec ^3(c+d x) (a \cos (c+d x)+b) (A+B \sec (c+d x)) \left (\frac{24 \left (2 a^3 A-4 a^2 b B+3 a A b^2-b^3 B\right ) (a \cos (c+d x)+b)^3 \tanh ^{-1}\left (\frac{(b-a) \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{\sqrt{a^2-b^2}}+54 a^3 A b^2 \sin (2 (c+d x))+39 a^2 A b^3 \sin (c+d x)-5 a^2 A b^3 \sin (3 (c+d x))+18 a^4 A b \sin (c+d x)+18 a^4 A b \sin (3 (c+d x))-18 a^3 b^2 B \sin (c+d x)-10 a^3 b^2 B \sin (3 (c+d x))-54 a^2 b^3 B \sin (2 (c+d x))-12 a^4 b B \sin (2 (c+d x))-6 a^5 B \sin (c+d x)-6 a^5 B \sin (3 (c+d x))+6 a A b^4 \sin (2 (c+d x))-51 a b^4 B \sin (c+d x)+a b^4 B \sin (3 (c+d x))+18 A b^5 \sin (c+d x)+2 A b^5 \sin (3 (c+d x))+6 b^5 B \sin (2 (c+d x))\right )}{24 d \left (b^2-a^2\right )^3 (a+b \sec (c+d x))^4 (A \cos (c+d x)+B)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.096, size = 376, normalized size = 1.6 \begin{align*}{\frac{1}{d} \left ( -2\,{\frac{1}{ \left ( \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}a- \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}b-a-b \right ) ^{3}} \left ( -1/2\,{\frac{ \left ( 6\,A{a}^{2}b+3\,Aa{b}^{2}+2\,A{b}^{3}-2\,B{a}^{3}-2\,B{a}^{2}b-6\,Ba{b}^{2}-B{b}^{3} \right ) \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{5}}{ \left ( a-b \right ) \left ({a}^{3}+3\,{a}^{2}b+3\,a{b}^{2}+{b}^{3} \right ) }}+2/3\,{\frac{ \left ( 9\,A{a}^{2}b+A{b}^{3}-3\,B{a}^{3}-7\,Ba{b}^{2} \right ) \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{3}}{ \left ({a}^{2}+2\,ab+{b}^{2} \right ) \left ({a}^{2}-2\,ab+{b}^{2} \right ) }}-1/2\,{\frac{ \left ( 6\,A{a}^{2}b-3\,Aa{b}^{2}+2\,A{b}^{3}-2\,B{a}^{3}+2\,B{a}^{2}b-6\,Ba{b}^{2}+B{b}^{3} \right ) \tan \left ( 1/2\,dx+c/2 \right ) }{ \left ( a+b \right ) \left ({a}^{3}-3\,{a}^{2}b+3\,a{b}^{2}-{b}^{3} \right ) }} \right ) }+{\frac{2\,A{a}^{3}+3\,Aa{b}^{2}-4\,B{a}^{2}b-B{b}^{3}}{{a}^{6}-3\,{a}^{4}{b}^{2}+3\,{a}^{2}{b}^{4}-{b}^{6}}{\it Artanh} \left ({(a-b)\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) \left ( a-b \right ) }}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.839856, size = 2707, normalized size = 11.42 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (A + B \sec{\left (c + d x \right )}\right ) \sec{\left (c + d x \right )}}{\left (a + b \sec{\left (c + d x \right )}\right )^{4}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.54549, size = 936, normalized size = 3.95 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]